# -*- encoding:utf-8 -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 5
_modified_time = 1292757740.147426
_template_filename='/home/sunzheng/Projects/FidoWeb/FidoWeb_0.98/fidoweb/templates/login/login.mako'
_template_uri='login/login.mako'
_template_cache=cache.Cache(__name__, _modified_time)
_source_encoding='utf-8'
from webhelpers.html import escape
_exports = []


def render_body(context,**pageargs):
    context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        __M_writer = context.writer()
        # SOURCE LINE 1
        __M_writer(u'<style type="text/css">\n.button_login{\n\tbottom:0;\n\tright:0;\n\tcursor:pointer;\n\tposition:absolute;\n\tfloat:left;\n\twidth:130px;\n\theight:45px;\n\tbackground:url(\'/image/global/button_login.png\');\n}\n.button_login:hover{background-position:0 -45px;}\n</style>\n<script type="text/javascript">\nfunction validateUsername(){\n\tvar username = $("#form_login #login_input_username").val();\n\tif (username.match("@") == null){\n\t\tif (!isValidMobile(username)) return false;\n\t\treturn true;\n\t}  else {\n\t\tif (!isValidEmail(username)) return false;\n\t\treturn true;\n\t}  \n}\nfunction validatePassword(){\n\tvar password = $("#form_login #login_input_password").val();\n\treturn isValidPassword(password);\n}\n$(document).ready(function(){\n\t$("#form_login").validationEngine();\n\n\t$("#button_login").click(function(){\n\t\t$.validationEngine.submitValidation("#form_login"); \n\t\tvar obj = this;\n\t\tvar username = $("#form_login #login_input_username").val();\n\t\tvar password = $("#form_login #login_input_password").val();\n\t\tif (!validateUsername()) return;\n\t\tif (!validatePassword()) return;\n\t\t$.validationEngine.buildPrompt("form #button_login", "\u6b63\u5728\u63d0\u4ea4\uff0c\u8bf7\u7a0d\u5019\u3002", "load");\n\t\t$.post("/login/getLoginCode", function(data){\n\t\t\tpassword = hex_sha512(data + hex_sha512(password));\n\t\t\t$.post("/login/doLogin", {username : username, password : password}, function(data){\n\t\t\t\tif (data == "success"){\n\t\t\t\t\t$.validationEngine.buildPrompt("#form_login #button_login", "\u767b\u5f55\u6210\u529f\uff01", "pass");\n\t\t\t\t\twindow.location.reload(); \n\t\t\t\t}  else if (data == "wrong username"){\n\t\t\t\t\t$.validationEngine.buildPrompt("#form_login #login_input_username", "\u60a8\u8f93\u5165\u7684\u624b\u673a\u53f7\u6216\u90ae\u7bb1\u4e0d\u6b63\u786e\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u3002", "error");\n\t\t\t\t}  else if (data == "wrong password"){\n\t\t\t\t\t$.validationEngine.buildPrompt("#form_login #login_input_password", "\u9519\u8bef\u7684\u5bc6\u7801\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u3002", "error");\n\t\t\t\t}  else if (data == "too fast"){\n\t\t\t\t\t$.validationEngine.buildPrompt("#form_login #button_login", "\u60a8\u7684\u767b\u5f55\u64cd\u4f5c\u8fc7\u4e8e\u9891\u7e41\uff0c\u8bf7\u7a0d\u5019\u5c1d\u8bd5\u3002", "error");\n\t\t\t\t}  else {\n\t\t\t\t\t$.validationEngine.buildPrompt("#form_login #button_login", "\u767b\u5f55\u5931\u8d25\u3002", "error");\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t});\n});\n</script>\n<div id="login_bound">\n\t<div class="page_column_left_padding15">\n\t\t<h1>\u767b\u5f55</h1>\n\t\t<div class="top"></div>\n\t\t<div class="content">\n\t\t\t<form id="form_login">\n\t\t\t\t<div id="login_mobile">\n\t\t\t\t\t<label>\u7528\u6237\u540d</label>\n\t\t\t\t\t<input id="login_input_username" type="text" name="mobile" class="validate[required,funcCall[validateUsername]]"></input>\n\t\t\t\t\t<span style="padding-left:20px;color:gray;">\uff08\u7528\u624b\u673a\u53f7\u6216\u90ae\u7bb1\u767b\u5f55\uff09</span>\n\t\t\t\t</div>\n\t\t\t\t<div id="login_password">\n\t\t\t\t\t<label>\u5bc6\u7801</label>\n\t\t\t\t\t<input id="login_input_password" type="password" name="password" class="validate[required,funcCall[validatePassword]]"></input>\n\t\t\t\t</div>\n\t\t\t\t<div id="bottom_buttons" style="clear:both;position:relative;">\n\t\t\t\t\t<span><a href="/login/forgetPassword" style="position:absolute;left:10px;top:10px;">\u5fd8\u8bb0\u5bc6\u7801\uff1f</a></span>\n\t\t\t\t\t<span id="button_login" class="button_login"></span>\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t</div>\n\t\t<div class="bottom"></div>\n\t</div>\n</div>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


